<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>人员脚本导入</title>
    <#include "/pubHeadStyle.html">
</head>
<body>
<!-- 表单布局 -->
<form class="layui-fluid bpmAuthorizeAdd layui-form" lay-filter="formTest" style="overflow: auto;">
    <div class="layui-row" style="border-top: 1px solid #ccc;">
        <div class="layui-col-md12">
            <label class="layui-form-label" style="text-align: center;line-height: 38px;font-weight: bold;">别名脚本开发帮助</label>
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-col-md2">
            <label class="layui-form-label" style="text-align: right;line-height: 38px;">步骤一：</label>
        </div>
        <div class="layui-col-md10">
            <div class="layui-input-block">
                <textarea class="layui-textarea" disabled="">引入RunAliasScript.js：
<script type="text/javascript" src="${ctx}/js/casic/platform/form/RunAliasScript.js"></script>；</textarea>
            </div>
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-col-md2">
            <label class="layui-form-label" style="text-align: right;line-height: 38px;">步骤二：</label>
        </div>
        <div class="layui-col-md10">
            <div class="layui-input-block">
                <textarea class="layui-textarea" disabled="" style="height: 175px;">构造需要向别名脚本传递的参数和对应的键值：
var conf = {
            aliasName:'别名（唯一的）',       //脚本的别名（唯一的）
            arg0:'参数值1',      //脚本的参数名和值（参数名必须按照建立别名脚本时的参数名填写）
            arg1:'参数值2'       //脚本的参数名和值
            ......
            }; </textarea>
            </div>
        </div>
    </div>
    <div class="layui-row default">
        <div class="layui-col-md2">
            <label class="layui-form-label" style="text-align: right;line-height: 38px;">步骤三：</label>
        </div>
        <div class="layui-col-md10">
            <div class="layui-input-block">
                <textarea class="layui-textarea" disabled="">调用RunAliasScript方法，传入脚本的别名和参数及其对应的值；
RunAliasScript(conf);       //结果是返回JSON数据 </textarea>
            </div>
        </div>
    </div>
    <div class="layui-row default">
        <div class="layui-col-md2">
            <label class="layui-form-label" style="text-align: right;line-height: 38px;">调用代码的例示：</label>
        </div>
        <div class="layui-col-md10">
            <div class="layui-input-block">
                <textarea class="layui-textarea" disabled="" style="height: 380px;"><script type="text/javascript" src="${ctx}/js/casic/platform/form/RunAliasScript.js"></script>
<script type="text/javascript">
$(function(){
    var conf = {
        aliasName:'testCode',      //脚本的别名（唯一的）
        arg0:'0',       //脚本的参数名和值（可以有多个不同名的参数）
        arg1:'two'
    };
    //执行别名脚本调用方法
    var json = RunAliasScript(conf);       //结果是返回JSON数据
    if(json.isSuccess==0){
        alert(json.result);       //显示脚本执行后返回的JSON结果
    }else{
        alert(json.msg);
    }
});
</script> </textarea>
            </div>
        </div>
    </div>
</form>
<!-- 三个及以上个 弹窗时启用的-->
<div id="windowUrls" style="display: none"></div>
<script type="text/html" id="bar">
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<script>
    layui.config({
        base: serverPath.systemPath + staticPath.systemPath //静态资源所在路径
    }).extend({
        index: 'index' //主入口模块
    }).use(['index','form','table','setter'],function(){
        var $ = layui.$;
        var form = layui.form;
        var table = layui.table;
        var setter = layui.setter;

        $('head').append('<link href="/css/workflow.css" rel="stylesheet" type="text/css" />');
        // 滚动条显示
        $('.layui-layout-body').css('overflow','auto');

        var id = "${aliasScript.id}";
        var aliasScriptScriptType = '${aliasScript.scriptType}'
        if (aliasScriptScriptType=='custom'){
            form.val("formTest", {
                "aliasName": "${aliasScript.aliasName}", // "name": "value"
                "aliasDesc": "${aliasScript.aliasDesc}", // "name": "value"
                "scriptType": "${aliasScript.scriptType}", // "name": "value"
                "className": "${aliasScript.className}", // "name": "value"
                "classInsName": "${aliasScript.classInsName}", // "name": "value"
                "methodName": "${aliasScript.methodName}", // "name": "value"
                "methodDesc": "${aliasScript.methodDesc}", // "name": "value"
                "returnType": "${aliasScript.returnType}", // "name": "value"
                "scriptComten": "${aliasScript.scriptComten}", // "name": "value"
                "enable": "${aliasScript.enable}", // "name": "value"
            });
            $('.custom').show();
            $('.default').hide();
        }else {
            form.val("formTest", {
                "aliasName": "${aliasScript.aliasName}", // "name": "value"
                "aliasDesc": "${aliasScript.aliasDesc}", // "name": "value"
                "scriptType": "${aliasScript.scriptType}", // "name": "value"
                "className": "${aliasScript.className}", // "name": "value"
                "classInsName": "${aliasScript.classInsName}", // "name": "value"
                "methodName": "${aliasScript.methodName}", // "name": "value"
                "methodDesc": "${aliasScript.methodDesc}", // "name": "value"
                "returnType": "${aliasScript.returnType}", // "name": "value"
                "scriptComten": "${aliasScript.scriptComten}", // "name": "value"
                "enable": "${aliasScript.enable}", // "name": "value"
            });
            $('.custom').hide();
            $('.default').show();
        }
    });
</script>
</body>
</html>